/**
 * 导航组件样式
 * 包含导航菜单和相关交互的样式定义
 */

/* 导航容器 */
.nav-container {
  position: relative;
  z-index: 50;
}

/* 导航链接基础样式 */
.nav-link {
  position: relative;
  transition: color 0.2s ease-out, 
              border-color 0.2s ease-out,
              background-color 0.2s ease-out;
  will-change: color, border-color, background-color;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 桌面导航链接下划线效果 */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: transparent;
  transition: width 0.2s ease-out, left 0.2s ease-out, background-color 0.2s ease-out;
}

.nav-link:hover::after {
  width: 100%;
  left: 0;
  background-color: #d1d5db;
}

.dark .nav-link:hover::after {
  background-color: #4b5563;
}

/* 当前活动链接样式 */
.nav-link.border-blue-500::after {
  width: 100%;
  left: 0;
  background-color: #3b82f6;
}

/* 移动端菜单样式 */
.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform-origin: top;
  overflow: hidden;
}

.dark .mobile-menu {
  background-color: #1f2937;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 
              0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

/* 用户菜单动画 */
#user-menu {
  transition: transform 0.2s ease-out,
              opacity 0.2s ease-out,
              visibility 0s linear 0.2s;
  transform-origin: top right;
  transform: scale(0.95);
  opacity: 0;
  visibility: hidden;
}

#user-menu:not(.hidden) {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
  transition: transform 0.2s ease-out,
              opacity 0.2s ease-out,
              visibility 0s linear 0s;
}

/* 暗色模式切换按钮动画 */
#dark-mode-toggle svg {
  transition: transform 0.3s ease-out, opacity 0.2s ease-out;
}

#dark-mode-toggle:hover svg {
  transform: rotate(12deg);
}